<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>for-of demo</title>
    <script src="../helpers/bing.js"></script>
  </head>
  <body>
    <script>
      const asyncFunction = async (item) => {
        await new Promise((resolve) => setTimeout(resolve, 1000));
        console.log(item);
      };
      const items = [
        "a",
        "b",
        "c",
        "d",
        "e",
        "f",
        "g",
        "h",
        "i",
        "j",
        "k",
        "l",
        "m",
        "n",
        "o",
        "p",
        "q",
        "r",
        "s",
        "t",
        "u",
        "v",
        "w",
        "x",
        "y",
        "z",
      ];
      const all = items.map(async (item) => {
        console.log("item", item);
        return await asyncFunction(item);
      });
      Promise.all(all)
        .then((res) => {
          console.log("Completed", res);
        });
    </script>
  </body>
</html>
